package 多线程.多线程创建.MyRunnable;


public class MyRunnable_Main {

    public static void main(String[] args) throws InterruptedException {
//        MyRunnable myRunnable = new MyRunnable();
//        Thread thread = new Thread(myRunnable);
//        thread.start();
//
//        for (int i = 0; i < 10; i++) {
//            System.out.println(Thread.currentThread().getName() + "执行了" + i + "次");
//        }
        Thread thread = new Thread(new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 10; i++) {
                    System.out.println(Thread.currentThread().getName() + "执行了" + i + "次");
                }
            }
        });
        thread.start();
    }
}
